package com.noisyair.android.alvin;

import android.app.Activity;
import android.inputmethodservice.Keyboard.Key;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;

public class TestDriverActivity extends Activity {
    /** Called when the activity is first created. */
	public String DEBUG_TAG = "Alvin";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(DEBUG_TAG, "======= initializing talker =======");
        Talker.init(this);
        setContentView(R.layout.main);
        
    }

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_CALL){
			Talker.setShouldTalk(true);
	        Log.i(DEBUG_TAG, "======= call key was pushed down =======");
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}

	@Override
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_CALL){
			Talker.setShouldTalk(false);
	        Log.i(DEBUG_TAG, "======= call key was let go =======");
			return true;
		}
		return super.onKeyUp(keyCode, event);
	}
    
    
}